/// 圈子成员关系数据模型
/// 表示用户与圈子之间的成员关系
class CircleMembership {
  final String circleId;
  final String userId;

  CircleMembership({required this.circleId, required this.userId});

  /// 从Map创建CircleMembership
  factory CircleMembership.fromMap(Map<String, dynamic> map) {
    return CircleMembership(
      circleId: map['circleId'] as String,
      userId: map['userId'] as String,
    );
  }

  /// 转换为Map
  Map<String, dynamic> toMap() {
    return {'circleId': circleId, 'userId': userId};
  }

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;
    return other is CircleMembership &&
        other.circleId == circleId &&
        other.userId == userId;
  }

  @override
  int get hashCode => circleId.hashCode ^ userId.hashCode;
}
